<%@include file="_header.jsp"%>
<%@include file="_menu.jsp"%>

<article id="article">

	<h3 style="align: center;">Bienvenido Profesor(a): ${user.name } ${user.lastname }</h3>
	
	<br/>
	
	<form id="filter-form" action="filter-course-by-semester.tecsup" method="post">
		<label>Semestre: </label>
		<select name="idsemester" id="idsemester" onchange="filterCourses()">
			<option value="0">Seleccione</option>
		<c:forEach items="${lstSemesters }" var="semester">
			<option value="${semester.idSemester }">${semester.description }</option>
		</c:forEach>
		</select>
	</form>
	
	<script type="text/javascript">
		function filterCourses(){
			var idsem = $('#idsemester').val();
			if(idsem != 0){
				$('#filter-form').submit();
			}
		}
	</script>
	
	<br/>
	<p>Cursos Asignados para el Semestre: <b>${ semester.description }</b></p>
	<br/>
	<table class="general-table">
		<thead>
			<tr>
				<th>C&oacute;digo</th>
				<th>Curso</th>
				<th>Semestre</th>
				<th>Tipo Curso</th>
				<th>Clase</th>
				<th>Horarios</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${ lstProfessorCourses}" var="profCourse" varStatus="i" >
				<c:choose>
					<c:when test="${(i.index)%2 == 0 }">
						<tr class="odd">
					</c:when>
					<c:otherwise>
						<tr>
					</c:otherwise>
				</c:choose>
					<td>${profCourse.myCourse.idCourse }</td>
					<td>${profCourse.myCourse.name }</td>
					<td>${profCourse.mySemester.description }</td>
					<td>${profCourse.myCourse.myTypeCourse.description }</td>
					<td>
						<a href="studen-list.tecsup?ic=${profCourse.myCourse.idCourse }&is=${profCourse.mySemester.idSemester}">Alumnos</a>
					</td>
					<td>
						<a href="programmed-classes.tecsup?ic=${profCourse.myCourse.idCourse }&is=${profCourse.mySemester.idSemester}">Ver</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<br/>	
</article>

<%@include file="_footer.jsp"%>